# coding: utf-8
from application import db


class UserGift(db.Model):
    __tablename__ = 'user_gift'

    id = db.Column(db.Integer, primary_key=True, info='ID')
    u_id = db.Column(db.Integer, nullable=False, info='user_id')
    g_id = db.Column(db.Integer, nullable=False, info='道具ID')
    num = db.Column(db.BigInteger, nullable=False, info='数量')
    created_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
    updated_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
    is_delete = db.Column(db.Integer, nullable=False, info='是否展示')
    all_num = db.Column(db.BigInteger, info='算上safebox中的总数量')
